package com.yuedao.sender.model1;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_users")
public class UserEntity {
    private int id;
    private String lastName;
    private String firstName;
    private Integer gender;
    private String identityNo;
    private Timestamp regTime;
    private String email;
    private Timestamp dob;
    private String homeAddress;
    private String emergencyContactFullname;
    private String emergencyContactPhoneNo;
    private Timestamp contractDate;
    private String photoPath;
    private int status;
    private Integer dividendTypeId;
    private int userTypeId;
    private String description;
   // private String companyAddress;

    private String aliUserId;
    private String aliLogonId;
    private String wxOpenid;
    private String wxUnionid;


    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "last_name", nullable = true, length = 32)
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    @Basic
    @Column(name = "first_name", nullable = true, length = 32)
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Basic
    @Column(name = "gender", nullable = true)
    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    @Basic
    @Column(name = "identity_no", nullable = true, length = 32)
    public String getIdentityNo() {
        return identityNo;
    }

    public void setIdentityNo(String identityNo) {
        this.identityNo = identityNo;
    }

    @Basic
    @Column(name = "reg_time", nullable = false)
    public Timestamp getRegTime() {
        return regTime;
    }

    public void setRegTime(Timestamp regTime) {
        this.regTime = regTime;
    }

    @Basic
    @Column(name = "email", nullable = true, length = 256)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "dob", nullable = false)
    public Timestamp getDob() {
        return dob;
    }

    public void setDob(Timestamp dob) {
        this.dob = dob;
    }

    @Basic
    @Column(name = "home_address", nullable = true, length = 1024)
    public String getHomeAddress() {
        return homeAddress;
    }

    public void setHomeAddress(String homeAddress) {
        this.homeAddress = homeAddress;
    }

    @Basic
    @Column(name = "emergency_contact_fullname", nullable = true, length = 32)
    public String getEmergencyContactFullname() {
        return emergencyContactFullname;
    }

    public void setEmergencyContactFullname(String emergencyContactFullname) {
        this.emergencyContactFullname = emergencyContactFullname;
    }

    @Basic
    @Column(name = "emergency_contact_phone_no", nullable = true, length = 32)
    public String getEmergencyContactPhoneNo() {
        return emergencyContactPhoneNo;
    }

    public void setEmergencyContactPhoneNo(String emergencyContactPhoneNo) {
        this.emergencyContactPhoneNo = emergencyContactPhoneNo;
    }

    @Basic
    @Column(name = "contract_date", nullable = false)
    public Timestamp getContractDate() {
        return contractDate;
    }

    public void setContractDate(Timestamp contractDate) {
        this.contractDate = contractDate;
    }

    @Basic
    @Column(name = "photo_path", nullable = true, length = 1024)
    public String getPhotoPath() {
        return photoPath;
    }

    public void setPhotoPath(String photoPath) {
        this.photoPath = photoPath;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "dividend_type_id", nullable = true)
    public Integer getDividendTypeId() {
        return dividendTypeId;
    }

    public void setDividendTypeId(Integer dividendTypeId) {
        this.dividendTypeId = dividendTypeId;
    }

    @Basic
    @Column(name = "user_type_id", nullable = false)
    public int getUserTypeId() {
        return userTypeId;
    }

    public void setUserTypeId(int userTypeId) {
        this.userTypeId = userTypeId;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }


    @Basic
    @Column(name = "ali_user_id", nullable = true, length = 2048)
    public String getAliUserId() {
        return aliUserId;
    }

    public void setAliUserId(String aliUserId) {
        this.aliUserId = aliUserId;
    }


    @Basic
    @Column(name = "ali_logon_id", nullable = true, length = 2048)
    public String getAliLogonId() {
        return aliLogonId;
    }

    public void setAliLogonId(String aliLogonId) {
        this.aliLogonId = aliLogonId;
    }


    @Basic
    @Column(name = "wx_openid", nullable = true, length = 2048)
    public String getWxOpenid() {
        return wxOpenid;
    }

    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }



    @Basic
    @Column(name = "wx_unionid", nullable = true, length = 2048)
    public String getWxUnionid() {
        return wxUnionid;
    }

    public void setWxUnionid(String wxUnionid) {
        this.wxUnionid = wxUnionid;
    }


/* @Basic
    @Column(name = "company_address", nullable = true, length = 1024)
    public String getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }
*/

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserEntity that = (UserEntity) o;

        if (id != that.id) return false;
        if (status != that.status) return false;
        if (userTypeId != that.userTypeId) return false;
        if (lastName != null ? !lastName.equals(that.lastName) : that.lastName != null) return false;
        if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return false;
        if (gender != null ? !gender.equals(that.gender) : that.gender != null) return false;
        if (identityNo != null ? !identityNo.equals(that.identityNo) : that.identityNo != null) return false;
        if (regTime != null ? !regTime.equals(that.regTime) : that.regTime != null) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (dob != null ? !dob.equals(that.dob) : that.dob != null) return false;
        if (homeAddress != null ? !homeAddress.equals(that.homeAddress) : that.homeAddress != null) return false;
        if (emergencyContactFullname != null ? !emergencyContactFullname.equals(that.emergencyContactFullname) : that.emergencyContactFullname != null)
            return false;
        if (emergencyContactPhoneNo != null ? !emergencyContactPhoneNo.equals(that.emergencyContactPhoneNo) : that.emergencyContactPhoneNo != null)
            return false;
        if (contractDate != null ? !contractDate.equals(that.contractDate) : that.contractDate != null) return false;
        if (photoPath != null ? !photoPath.equals(that.photoPath) : that.photoPath != null) return false;
        if (dividendTypeId != null ? !dividendTypeId.equals(that.dividendTypeId) : that.dividendTypeId != null)
            return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
        result = 31 * result + (gender != null ? gender.hashCode() : 0);
        result = 31 * result + (identityNo != null ? identityNo.hashCode() : 0);
        result = 31 * result + (regTime != null ? regTime.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (dob != null ? dob.hashCode() : 0);
        result = 31 * result + (homeAddress != null ? homeAddress.hashCode() : 0);
        result = 31 * result + (emergencyContactFullname != null ? emergencyContactFullname.hashCode() : 0);
        result = 31 * result + (emergencyContactPhoneNo != null ? emergencyContactPhoneNo.hashCode() : 0);
        result = 31 * result + (contractDate != null ? contractDate.hashCode() : 0);
        result = 31 * result + (photoPath != null ? photoPath.hashCode() : 0);
        result = 31 * result + status;
        result = 31 * result + (dividendTypeId != null ? dividendTypeId.hashCode() : 0);
        result = 31 * result + userTypeId;
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
